package com.itheima.d4_collection_set;

import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;

public class SetTest4 {
    public static void main(String[] args) {

        Set<Integer> set1 =new TreeSet<>();
        set1.add(6);
        set1.add(5);
        set1.add(5);
        set1.add(7);

        System.out.println(set1);

        Set<Student> students =new TreeSet<>((o1, o2) -> Double.compare(o1.getHeight(),o2.getHeight()));
        students.add(new Student("含山",213,321.2));
        students.add(new Student("2山",214,32));
        students.add(new Student("3山",223,32122));
        System.out.println(students);


    }
}
